home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.1 (User) / OpenStep 4.1 (User).iso / private / etc / ppp / Examples / ppp_multiple_hosts / ppp < prev    next >
Encoding:
Text File  |  1995-01-30  |  660 b   |  43 lines

  1. #!/bin/sh
  2. #    ppp  --  Shell script that allows you to start and stop ppp conns.
  3. #
  4.  
  5. if [ "`whoami`" != "root" ]; then
  6.     echo "You must be root to modify ppp connections."
  7.     exit 1;
  8. fi
  9.  
  10. if [ "$#" = "1" -a "$1" = "list" ]; then
  11.     echo "Available PPP hosts:"
  12.     (cd /etc/ppp/hosts ; /bin/ls -d *);
  13. fi
  14.  
  15. if [ "$#" != "2" ]; then
  16.     echo "Usage: $0 {list, host {up,down,status}}"
  17.     exit 1;
  18. fi
  19.  
  20. if [ ! -d "/etc/ppp/hosts/$1" ]; then
  21.     echo "${1}: No such PPP host";
  22.     exit 1;
  23. fi
  24.  
  25. COMM=/etc/ppp/commandHost
  26.  
  27. case "$2" in
  28.     up)
  29.         ${COMM} "$1" up 
  30.         ;;
  31.     down)
  32.         ${COMM} "$1" down
  33.         ;;
  34.     status)
  35.         ${COMM} "$1" status
  36.         ;;
  37.     *)
  38.         echo "Usage: $0 host {up,down,status}"
  39.         exit 1;
  40. esac
  41.  
  42.  
  43.